Artificial Neural Network Classification
ANN classification refers to the use of Artificial Neural Networks (ANNs) for solving classification problems. ANNs are computational models inspired by the biological neural networks in the human brain. They consist of interconnected nodes called artificial neurons or units, organized into layers.
In the context of classification, ANNs are trained to learn the patterns and relationships in a given dataset and make predictions about the class or category of new, unseen data points. The training process involves presenting the network with a set of labeled examples, where each example consists of input features and the corresponding target class. The network adjusts its internal parameters, known as weights and biases, based on the error between its predictions and the true labels.
The most common architecture for classification tasks is the feedforward neural network, where information flows in one direction from the input layer through one or more hidden layers to the output layer. Each neuron in a layer receives inputs from the previous layer, performs a computation using its weights and biases, and passes the result to the next layer. The output layer typically represents the predicted class probabilities or directly predicts the class label.
Method: POST Authorization: API Keyhttps://engine.raccoon-ai.io/api/v1/ml/classification/ann
Authorization
Type | Key | Value |
---|---|---|
API Key | X-Api-Key | rae_###### |
Request Body
Section | Key | Data Type | Required | Description |
---|---|---|---|---|
train | data | json | true | Data that use to train the model |
features | list | true | Input features (X) | |
targets | list | true | Output targets (y) | |
config | json | false | Train configurations | |
predict | data | json | true | Data that need to predicted by the trained model |
config | json | false | Predict configurations |
Types
{
"train" : {
"data" : <json_data>,
"features": <list>,
"targets" : <list>,
"config" : {
"std_scale": <boolean>,
"encoder" : <"label" | "drop">,
"val_size" : <float>
}
},
"predict": {
"data": <json_data>,
"config": {
"include_inputs": <boolean>,
"round": <int>
}
}
}
Sample
{
"train": {
"data": {
"R&D Spend": {
"0": 165349.2,
"1": 162597.7,
"2": 153441.51,
"3": 144372.41,
"4": 142107.34,
"5": 131876.9,
"6": 134615.46,
"7": 130298.13,
"8": 120542.52,
"9": 123334.88
},
"Administration": {
"0": 136897.8,
"1": 151377.59,
"2": 101145.55,
"3": 118671.85,
"4": 91391.77,
"5": 99814.71,
"6": 147198.87,
"7": 145530.06,
"8": 148718.95,
"9": 108679.17
},
"Marketing Spend": {
"0": 471784.1,
"1": 443898.53,
"2": 407934.54,
"3": 383199.62,
"4": 366168.42,
"5": 362861.36,
"6": 127716.82,
"7": 323876.68,
"8": 311613.29,
"9": 304981.62
},
"State": {
"0": "New York",
"1": "California",
"2": "Florida",
"3": "New York",
"4": "Florida",
"5": "New York",
"6": "California",
"7": "Florida",
"8": "New York",
"9": "California"
},
"Profit": {
"0": 192261.83,
"1": 191792.06,
"2": 191050.39,
"3": 182901.99,
"4": 166187.94,
"5": 156991.12,
"6": 156122.51,
"7": 155752.6,
"8": 152211.77,
"9": 149759.96
}
},
"features": ["R&D Spend", "Administration", "Marketing Spend", "Profit"],
"targets": ["State"],
"config": {
"std_scale": true,
"encoder": "label",
"hidden_units": [100, 100],
"max_iter": 1000
}
},
"predict": {
"data": {
"R&D Spend": {
"0": 165349.2,
"1": 162597.7
},
"Administration": {
"0": 136897.8,
"1": 151377.59
},
"Marketing Spend": {
"0": 471784.1,
"1": 443898.53
},
"Profit": {
"0": 471784.1,
"1": 443898.53
}
},
"config": {
"include_inputs": true,
"round": 2
}
}
}
Reponse Body
Key | Data Type | Description |
---|---|---|
success | boolean | Indicate the success of the request |
msg | string | Message indicators |
error | string | Error information, only set if success is false |
result | json | Result, only set if success is true |
score | json | Accuracy score of the training and testing phases, only set if success is true |
generated_ts | float | Generated timestamp |
Types
{
"success": <boolean>,
"msg": <string>,
"error": <string>,
"result": <json>,
"score": {
"train": <float>,
"test": <float>
},
"generated_ts": <timestamp>
}
Sample
{
"success": true,
"msg": "Model trained and predicted successfully",
"error": null,
"result": {
"R&D Spend": {
"0": 165349.2,
"1": 162597.7
},
"Administration": {
"0": 136897.8,
"1": 151377.59
},
"Marketing Spend": {
"0": 471784.1,
"1": 443898.53
},
"Profit": {
"0": 190209.72,
"1": 186863.18
},
"State": {
"0": "New York",
"1": "California"
}
},
"score": {
"train": 0.942446542689397,
"test": 0.9649618042060305
},
"saved_in": null,
"generated_ts": 1685439220.425382
}